<template>
    <div class="app">
      <el-container>
        <el-header>
          <!--logo-->
          <div class="logo_img">
            <router-link :to="{name:'Index'}">
              <img src="https://static.pxto.com.cn/statics/Home/images/logo.png" style="height: 50px;width: 200px" alt="首页">
            </router-link>
            <div style="float: right;width: 200px;height: 50px">
              <span>欢迎：{{this.token}} </span>&nbsp;&nbsp;
              <span><router-link style="text-decoration: none;" :to="{name:'Index'}">退出登录</router-link> </span>
            </div>
          </div>

        </el-header>
        <el-container style="">
          <el-aside width="230px" style="height: 652px">
              <el-row class="tac" >
                <el-col  :span="24" >
                  <el-menu  :default-active="$route.path" router style="height: 650px"  class="el-menu-vertical-demo">
                    <el-menu-item index="/user">
                      <i class="el-icon-user"></i>
                      <span slot="title">用户管理</span>
                    </el-menu-item>
                    <el-menu-item  index="/role">
                      <i class="el-icon-coordinate"></i>
                        <span slot="title">
                           角色管理
                        </span>
                    </el-menu-item>
                    <el-menu-item index="/cou">
                      <i class="el-icon-document"></i>
                      <span slot="title">课程管理</span>
                    </el-menu-item>
                    <el-menu-item index="/sc">
                      <i class="el-icon-office-building"></i>
                      <span slot="title">机构管理</span>
                    </el-menu-item>
                    <el-menu-item index="/ne">
                      <i class="el-icon-chat-square"></i>
                      <span slot="title">资讯管理</span>
                    </el-menu-item>
                    <el-menu-item index="/dy">
                      <i class="el-icon-odometer"></i>
                      <span slot="title">动态管理</span>
                    </el-menu-item>
                  </el-menu>
                </el-col>
              </el-row>
          </el-aside>
          <el-container>
            <el-main>
              <router-view/>
            </el-main>
            <el-footer>
              copyright © 2010-today pxto.com.cn, All Rights Reserved.
            </el-footer>
          </el-container>
        </el-container>
      </el-container>

    </div>
</template>

<script>
    export default {
        name: "Admin",
      data(){
          return{
            data:{},//查询到的数据
            token:''
          }
      },
      methods:{
        /*查询所有用户*/
        findAll(id){//查询所有
          let _this = this
          console.log(id)
          this.$axios.get("http://localhost:8066/user/getUserById/"+id).then(function(res){
            _this.data = res.data
            console.log(_this.data)
          }).catch(function (err) {
            alert('查询失败')
          })
        },

        findToken(){
          this.token = localStorage.getItem("login");
        },
        exit(){
          localStorage.removeItem("login")
          this.$router.push({name:'Index'})
        }
      },
      mounted(){
        this.findToken();
      },
    }
</script>

<style scoped>
  .el-header {
    background-color: white;
    color: #333;
    /*text-align: center;*/
    border: 1px solid rgba(238,236,237,0.94);
    line-height: 60px;
  }
  .el-footer{
    color: #333;
    background-color: #F6F6F6;
    text-align: center;
    font-size: 1px;
    line-height: 50px;
  }

  .el-aside {
    /*background-color: #D3DCE6;*/
    color: #333;
    /*text-align: center;*/
    /*line-height: 200px;*/
  }

  .el-main {
    background-color: #F6F6F6;
    color: #333;

    /*text-align: center;*/
    /*line-height: 160px;*/
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>
